<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增用户')"/>
</head>
<body>
<div class="main-content">
    <form id="form-user-add" class="form-horizontal">
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">路段选择</label>
                    <div class="col-sm-8">
                        <div class="input-group" style="width: 100%">
                            <select  id="road_name" name="road_name" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                                <option  th:each="road : ${pavementStructure.rdRoadSections}" th:text="${road.sectionName}"
                                        th:value="${road.sectionName}" onclick="doSure()"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">面层结构组合</label>
                    <div class="col-sm-8">
                        <div class="input-group" style="width: 100%">
                            <select id="roadSurfaceStructureList" name="roadCombinationOfSurfaceMaterial" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                                <option  th:each="surface : ${pavementStructure.stringArrayRoadSurfaceStructureList}" th:text="${surface}"
                                        th:value="${surface}" onclick="doSure()"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">基层结构组合</label>
                    <div class="col-sm-8">
                        <div class="input-group" style="width: 100%">
                            <select id="roadBaseStructureList" name="roadCombinationOfBaseMaterial" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                                <option  th:each="base : ${pavementStructure.stringArrayRoadBaseStructureList}" th:text="${base}"
                                        th:value="${base}" onclick="doSure()"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">基层厚度组合</label>
                    <div class="col-sm-8">
                        <div class="input-group" style="width: 100%">
                            <select id="roadBaseThicknessList" name="roadCombinationOfBaseMaterial" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                                <option  th:each="base : ${pavementStructure.stringArrayRoadBaseThicknessList}" th:text="${base}"
                                         th:value="${base}" onclick="doSure()"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">面层厚度组合</label>
                    <div class="col-sm-8">
                        <div class="input-group" style="width: 100%">
                            <select id="roadSurfaceThicknessList" name="roadCombinationOfBaseMaterial" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                                <option  th:each="base : ${pavementStructure.stringArrayRoadSurfaceThicknessList}" th:text="${base}"
                                         th:value="${base}" onclick="doSure()"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存
            </button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭
            </button>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script>
    var prefixPavementStructure=ctx +"road/pavement_structure";
    function submitHandler(){
        if ($.validate.form("form-user-add")){
            var road=$.form.selectSelects("road_name");
            var roadSurfaceStructureList=$.form.selectSelects("roadSurfaceStructureList");
            var roadBaseStructureList=$.form.selectSelects("roadBaseStructureList");
            var roadBaseThicknessList=$.form.selectSelects("roadBaseThicknessList");
            var roadSurfaceThicknessList=$.form.selectSelects("roadSurfaceThicknessList");
            var data={road:road,
                roadSurfaceStructureList:roadSurfaceStructureList,
                roadBaseStructureList:roadBaseStructureList,
                roadBaseThicknessList:roadBaseThicknessList,
                roadSurfaceThicknessList:roadSurfaceThicknessList}
            $.operate.post(prefixPavementStructure+"/saveRoadPavementMaterialsInit",
                data);
        }
    };
</script>
</body>
</html>
